<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        //if-else改写三元运算

        //if-else-if优化

        // 100=>x=>90优秀 90>x>=75不错 75>x>=60及格  60>x 挂科
        var score = prompt("请输入分数");
        // var yx = (100 >= score >= 90);
        var yx1 = score <= 100 && score >= 90;
        // var bc = 90 > score >= 75;
        var bc1 = score >= 75
        // var jg = 75 > score >= 60;
        var jg1 = score >= 60
        var gk = score < 60;

        if (yx1) {
            console.log("你很优秀")
        } else if (bc1) {
            console.log('非常不错')
        } else if (jg1) {
            console.log('及格了')
        } else {
            console.log("挂科了")
        };

        var year = prompt("请输入年份！");
        var condition  = (year %4 ==0 && year % 100 != 0) || year % 400 == 0;
        // a ? b : c
        condition ?  console.log( year + "是闰年") : console.log( year + "不是闰年")
            

    </script>
</body>

</html>